<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateYsPostsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('posts', function(Blueprint $table)
		{
			$table->increments('id')->comment('主键id');
			$table->bigInteger('uid')->comment('关联用户id');
			$table->string('bar_num', 32)->comment('关联吧id');
			$table->string('book_num', 32)->nullable()->comment('关联书籍id为空不关联');
			$table->string('title')->comment('帖子标题');
			$table->text('content')->nullable()->comment('帖子内容');
			$table->tinyInteger('status')->nullable()->default(0)->comment('帖子状态0为正常');
			$table->tinyInteger('recommend')->nullable()->default(0)->comment('精推荐1为推荐');
			$table->tinyInteger('top')->nullable()->default(0)->comment('是否置顶1为置顶');
			$table->text('image')->nullable()->comment('发表图片');
			$table->integer('release_time')->nullable()->default(0)->comment('发布时间');
			$table->tinyInteger('author_reply')->nullable()->default(0)->comment('作者回复1为回复');
			$table->string('article_chapter', 32)->nullable()->comment('文章章节关联关联为章节索引不关联为null');
			$table->tinyInteger('recommend_review')->nullable()->default(0)->comment('推荐书评1为推荐');
			$table->tinyInteger('authority_recommend')->nullable()->default(0)->comment('知书推荐1为推荐');
			$table->dateTime('hot_at')->nullable()->comment('热门帖子产生时间');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('posts');
	}

}
